<?php

namespace Application\View\Helper;

class WidgetManager extends \Zend\View\Helper\AbstractHelper {
    
    protected $widgets = array();
    
    public function __invoke() {
        $response = '';
        
        foreach ($this->widgets as $widget) {
            $response .= $widget->render();
        }
        
        return $response;
    }
    
    public function addWidget($widget) {
        $this->widgets[] = $widget;
    }
    
}